@tool
extends EditorPlugin

const BUILDING_CONSTRUCTOR_VIEW = preload("res://addons/procedural_building_constructor/building_constructor_view.tscn")

var panel_instance: Control

func _enter_tree() -> void:
	panel_instance = BUILDING_CONSTRUCTOR_VIEW.instantiate()
	EditorInterface.get_editor_main_screen().add_child(panel_instance)
	# Initialization of the plugin goes here.
	_make_visible(false)


func _exit_tree() -> void:
	if panel_instance:
		panel_instance.queue_free()
	# Clean-up of the plugin goes here.
	pass

func _has_main_screen():

	return true


func _make_visible(visible):
	if panel_instance:
		panel_instance.visible = visible


func _get_plugin_name():
	return "Building Constructor"


func _get_plugin_icon():
	return EditorInterface.get_editor_theme().get_icon("Node", "EditorIcons")
